package love.yuanmengrobot.guoyitang.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import love.yuanmengrobot.guoyitang.entity.User;
import love.yuanmengrobot.guoyitang.mapper.UserMapper;
import love.yuanmengrobot.guoyitang.service.UserService;
import org.springframework.data.redis.core.*;
import java.util.List;
import java.util.concurrent.TimeUnit;

import org.springframework.beans.factory.annotation.Autowired;

import org.springframework.stereotype.Service;

import javax.annotation.Resource;

@Service
public class UserServiceImpl implements UserService {

	@Resource
	UserMapper userMapper;

	@Override
	public List<User> findAll() {
		// TODO 存入redis数据


		return userMapper.selectList(null);
	}

	@Override
	public User findUserBywxOpenId(User user) {


		return userMapper.selectOne(new QueryWrapper<User>().eq("wx_openid", user.getWxOpenid()));
	}


}
